home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Development Kits / MPW etc / MPW-GM / Interfaces&Libraries / Interfaces / CIncludes / ioctl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-17  |  1.7 KB  |  66 lines  |  [TEXT/MPS ]

  1. /*
  2.     IOCtl.h -- Device-handler-specific requests
  3.  
  4.     Warning:  This interface is NOT a part of the ANSI C standard.
  5.              We do NOT claim to be POSIX compliant.
  6.              If you want your code to be portable, don't use this interface.
  7.  
  8.     Copyright, Apple Computer Inc. 1985-1991, 1995
  9.     All rights reserved.
  10. */
  11.  
  12. # ifndef __IOCTL__
  13. # define __IOCTL__
  14.  
  15.  
  16. /*
  17.  *        ioctl() function prototype
  18.  */
  19.  
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23.  
  24. #if defined (__powerc) || defined (powerc) || defined (__CFM68K__)
  25.     #pragma import on
  26. #endif
  27.  
  28. int ioctl(int fildes, unsigned int cmd, long *arg);
  29.  
  30. #if defined (__powerc) || defined (powerc) || defined (__CFM68K__)
  31.     #pragma import off
  32. #endif
  33.  
  34. #ifdef __cplusplus
  35. }
  36. #endif
  37.  
  38. /*
  39.  *   IO Control commands.
  40.  *
  41.  *   IOCTLs which begin with "FIO" are controls which are general
  42.  *          (device driver) control requests.  They may be executed by 
  43.  *         the top-level ioctl() procedure, or previewed by it before 
  44.  *         passing it on to the driver xxIoctl()s.
  45.  */
  46.  
  47. # define FIOLSEEK         (('f'<<8)|0x00)     /* Apple internal use only */
  48. # define FIODUPFD         (('f'<<8)|0x01)     /* Apple internal use only */
  49.  
  50. # define FIOINTERACTIVE (('f'<<8)|0x02)     /* If device is interactive */
  51. # define FIOBUFSIZE        (('f'<<8)|0x03)     /* Return optimal buffer size */
  52. # define FIOFNAME         (('f'<<8)|0x04)     /* Return filename */
  53. # define FIOREFNUM        (('f'<<8)|0x05)     /* Return fs refnum */
  54. # define FIOSETEOF        (('f'<<8)|0x06)     /* Set file length */
  55.  
  56. /*
  57.  *   IOCTLs which begin with "TIO" are for TTY (i.e., console or 
  58.  *         terminal-related) device control requests.
  59.  */
  60.  
  61. # define TIOFLUSH   (('t'<<8)|0x00)        /* discard unread input.  arg is ignored */
  62. # define TIOSPORT   (('t'<<8)|0x01)        /* Obsolete -- do not use */
  63. # define TIOGPORT   (('t'<<8)|0x02)        /* Obsolete -- do not use */
  64.  
  65. # endif /*__IOCTL__*/
  66.